<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script>
			//创建数组，并赋值
			var mycars = new Array();
			mycars[0] = "Saab";
			mycars[1] = "Volvo";
			mycars[2] = "BMW";
			//简洁方式
			var myCars = new Array("Saab","Volvo","BWM");
			//字面
			var myCars = ["Saab","Volvo","BWM"];
			//在一个数组中你可以有不同的对象
			myCars[0] = new Date();
			myCars[1] = function(){};
			myCars[2] = new Array();
			//数组的方法与属性
			var x = myCars.length;
			var y = myCars.indexOf("Volvo");
			
			//创建新方法
			Array.prototype.myUcase = function(){
				for(var i in this){
					this[i] = this[i].toUpperCase();
				}
			}
		</script>
	</body>
</html>